package routers

import (
	"myk8s/controllers"

	beego "github.com/beego/beego/v2/server/web"
)

func init() {
	beego.Router("/node/v1/List", &controllers.NodeController{}, "*:List")
	beego.Router("/node/v1/Unschedulable", &controllers.NodeController{}, "*:Unschedulable")
	beego.Router("/node/v1/Drain", &controllers.NodeController{}, "*:Drain")

	beego.Router("/pod/v1/List", &controllers.PodController{}, "*:List")
	beego.Router("/pod/v1/ContainerList", &controllers.PodController{}, "*:ContainerList")
	beego.Router("/pod/v1/Log", &controllers.PodController{}, "*:Log")
	beego.Handler("/pod/terminal/ws", &controllers.TerminalSockjs{}, true)

	beego.Router("/deploy/v1/List", &controllers.DeployController{}, "*:List")
	beego.Router("/deploy/v1/Restart", &controllers.DeployController{}, "*:Restart")
	beego.Router("/deploy/v1/Yaml", &controllers.DeployController{}, "*:Yaml")
	beego.Router("/deploy/v1/Create", &controllers.DeployController{}, "*:Create")

	//hpa
	beego.Router("/hpa/v1/List", &controllers.HpaController{}, "*:List")
	beego.Router("/hpa/v1/Yaml", &controllers.HpaController{}, "*:Yaml")
	beego.Router("/hpa/v1/Create", &controllers.HpaController{}, "*:Create")
	beego.Router("/hpa/v1/Del", &controllers.HpaController{}, "*:Del")

	//cronjob
	beego.Router("/cronjob/v1/List", &controllers.CronjobController{}, "*:List")
	beego.Router("/cronjob/v1/Create", &controllers.CronjobController{}, "*:Create")
	beego.Router("/cronjob/v1/ModifyByYaml", &controllers.CronjobController{}, "*:ModifyByYaml")
	beego.Router("/cronjob/v1/Yaml", &controllers.CronjobController{}, "*:Yaml")

	//configmap
	beego.Router("/cm/v1/List", &controllers.ConfigMapController{}, "*:List")
	beego.Router("/cm/v1/Create", &controllers.ConfigMapController{}, "*:Create")
	beego.Router("/cm/v1/ModifyByYaml", &controllers.ConfigMapController{}, "*:ModifyByYaml")
	beego.Router("/cm/v1/Yaml", &controllers.ConfigMapController{}, "*:Yaml")

	//svc
	beego.Router("/svc/v1/List", &controllers.SvcController{}, "*:List")
	beego.Router("/svc/v1/Create", &controllers.SvcController{}, "*:Create")
	beego.Router("/svc/v1/ModifyByYaml", &controllers.SvcController{}, "*:ModifyByYaml")
	beego.Router("/svc/v1/Yaml", &controllers.SvcController{}, "*:Yaml")

	//ingress
	beego.Router("/ing/v1/List", &controllers.IngressController{}, "*:List")
	beego.Router("/ing/v1/Create", &controllers.IngressController{}, "*:Create")
	beego.Router("/ing/v1/ModifyByYaml", &controllers.IngressController{}, "*:ModifyByYaml")
	beego.Router("/ing/v1/Yaml", &controllers.IngressController{}, "*:Yaml")

	//event
	beego.Router("/event/v1/List", &controllers.EventController{}, "*:List")

	//storageclass
	beego.Router("/storage/v1/StorageclassList", &controllers.StorageController{}, "*:StorageclassList")
	//beego.Router("/storage/v1/StorageclassYaml", &controllers.StorageClassController{}, "*:StorageclassYaml")

	//pv
	beego.Router("/storage/v1/PvList", &controllers.StorageController{}, "*:PvList")
	//beego.Router("/storage/v1/PvYaml", &controllers.PvController{}, "*:PvYaml")

	//pvc
	beego.Router("/storage/v1/PvcList", &controllers.StorageController{}, "*:PvcList")
	//beego.Router("/storage/v1/PvcYaml", &controllers.PvcController{}, "*:PvcYaml")
}
